#include<iostream>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<vector>

using namespace std;

void test1()
{
	srand(time(0));
	map<int, string, greater<int>>con1;
	unordered_map<int, string>con2;
	const int N = 10000000;
	int begin1 = clock();
	for (int i = 0; i < N; i++)
		con1.emplace(i, "Hello C++11");
	//con1.emplace(i + rand() % 1000000000, "Hello C++11");
	int end1 = clock();
	int begin2 = clock();
	for (int i = 0; i < N; i++)
		con2.emplace(i, "Hello C++11");
	//con2.emplace(i + rand() % 1000000000, "Hello C++11");
	int end2 = clock();
	cout << "map emplace:" << end1 - begin1 << endl;
	cout << "map size:" << con1.size() << endl;
	cout << "unordered_map emplace:" << end2 - begin2 << endl;
	cout << "unordered_map size:" << con2.size() << endl;

}

void test2()
{
	srand(time(0));
	multimap<int, string, greater<int>>con1;
	unordered_multimap<int, string>con2;
	const int N = 10000000;
	int begin1 = clock();
	for (int i = 0; i < N; i++)
		con1.emplace(i, "Hello C++11");
	//con1.emplace(i + rand() % 1000000000, "Hello C++11");
	int end1 = clock();
	int begin2 = clock();
	for (int i = 0; i < N; i++)
		con2.emplace(i, "Hello C++11");
	//con2.emplace(i + rand() % 1000000000, "Hello C++11");
	int end2 = clock();
	cout << "map emplace:" << end1 - begin1 << endl;
	cout << "map size:" << con1.size() << endl;
	cout << "unordered_map emplace:" << end2 - begin2 << endl;
	cout << "unordered_map size:" << con2.size() << endl;

}

int main()
{
	//test1();
	test2();

	return 0;
}